DIR=$(cd "$(dirname "$0")";pwd)
mv ${DIR}/health.sh.x ${DIR}/health
chmod +x ${DIR}/health
cp -rvf ${DIR}/health /opt/apexapp/.local/bin/
sudo cat /var/spool/cron/yapai | grep health
if [[ $? -eq 1 ]]
then
  sudo sed -i '$a\*/5 * * * * /opt/apexapp/.local/bin/health >> /opt/apexapp/logs/health_check.log 2>&1' /var/spool/cron/yapai
fi
if [[ ! -d ${HOME}/.config/zxhtom ]]
then
  mkdir -p ${HOME}/.config/zxhtom
fi
if [[ ! -f ${HOME}/.config/zxhtom/config.json ]]
then
  cp -rvf ${DIR}/config.json ${HOME}/.config/zxhtom/
fi
